<!doctype html>
<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>helix-front documentation</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
	   <link rel="stylesheet" href="../styles/style.css">
        <link rel="stylesheet" href="../styles/dark.css">
    </head>
    <body>

        <div class="navbar navbar-default navbar-fixed-top visible-xs">
            <a href="../" class="navbar-brand">helix-front documentation</a>
            <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
        </div>

        <div class="xs-menu menu" id="mobile-menu">
                <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div>            <compodoc-menu></compodoc-menu>
        </div>

        <div class="container-fluid main">
           <div class="row main">
               <div class="hidden-xs menu">
                   <compodoc-menu mode="normal"></compodoc-menu>
               </div>
               <!-- START CONTENT -->
               <div class="content component">
                   <div class="content-data">




<ol class="breadcrumb">
  <li>Components</li>
  <li
  >
  ClusterDetailComponent</li>
</ol>

<ul class="nav nav-tabs" role="tablist">
        <li class="active">
            <a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
        </li>
        <li >
            <a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
        </li>
        <li >
            <a href="#templateData" role="tab" id="templateData-tab" data-toggle="tab" data-link="template">Template</a>
        </li>
        <li >
            <a href="#styleData" role="tab" id="styleData-tab" data-toggle="tab" data-link="style">Styles</a>
        </li>
        <li >
            <a href="#tree" role="tab" id="tree-tab" data-toggle="tab" data-link="dom-tree">DOM Tree</a>
        </li>
</ul>

<div class="tab-content">
    <div class="tab-pane fade active in" id="c-info"><p class="comment">
    <h3>File</h3>
</p>
<p class="comment">
    <code>src/app/cluster/cluster-detail/cluster-detail.component.ts</code>
</p>




    <p class="comment">
        <h3>Implements</h3>
    </p>
    <p class="comment">
                    <code><a href="https://angular.io/api/core/OnInit" target="_blank" >OnInit</a></code>
    </p>


<section>
    <h3>Metadata</h3>
    <table class="table table-sm table-hover metadata">
        <tbody>









            <tr>
                <td class="col-md-3">providers</td>
                <td class="col-md-9">
                                <code><a href="../injectables/InstanceService.html" target="_self" >InstanceService</a></code>
                </td>
            </tr>


            <tr>
                <td class="col-md-3">selector</td>
                <td class="col-md-9"><code>hi-cluster-detail</code></td>
            </tr>

            <tr>
                <td class="col-md-3">styleUrls</td>
                <td class="col-md-9"><code>./cluster-detail.component.scss</code></td>
            </tr>



            <tr>
                <td class="col-md-3">templateUrl</td>
                <td class="col-md-9"><code>./cluster-detail.component.html</code></td>
            </tr>








        </tbody>
    </table>
</section>

    <section>
    <h3 id="index">Index</h3>
    <table class="table table-sm table-bordered index-table">
        <tbody>
                <tr>
                    <td class="col-md-4">
                        <h6><b>Properties</b></h6>
                    </td>
                </tr>
                <tr>
                    <td class="col-md-4">
                        <ul class="index-list">
                            <li>
                                <a href="#can" >can</a>
                            </li>
                            <li>
                                <a href="#cluster" >cluster</a>
                            </li>
                            <li>
                                <a href="#clusterName" >clusterName</a>
                            </li>
                            <li>
                                <a href="#isLoading" >isLoading</a>
                            </li>
                            <li>
                                    <span class="modifier">Readonly</span>
                                <a href="#tabLinks" >tabLinks</a>
                            </li>
                        </ul>
                    </td>
                </tr>

                <tr>
                    <td class="col-md-4">
                        <h6><b>Methods</b></h6>
                    </td>
                </tr>
                <tr>
                    <td class="col-md-4">
                        <ul class="index-list">
                            <li>
                                <a href="#activateCluster" >activateCluster</a>
                            </li>
                            <li>
                                <a href="#addInstance" >addInstance</a>
                            </li>
                            <li>
                                <a href="#deleteCluster" >deleteCluster</a>
                            </li>
                            <li>
                                <a href="#disableCluster" >disableCluster</a>
                            </li>
                            <li>
                                <a href="#disableMaintenanceMode" >disableMaintenanceMode</a>
                            </li>
                            <li>
                                <a href="#enableCluster" >enableCluster</a>
                            </li>
                            <li>
                                <a href="#enableMaintenanceMode" >enableMaintenanceMode</a>
                            </li>
                            <li>
                                    <span class="modifier">Protected</span>
                                <a href="#loadCluster" >loadCluster</a>
                            </li>
                            <li>
                                <a href="#ngOnInit" >ngOnInit</a>
                            </li>
                        </ul>
                    </td>
                </tr>





        </tbody>
    </table>
</section>

    <section>
    <h3 id="constructor">Constructor</h3>
        <table class="table table-sm table-bordered">
            <tbody>
                <tr>
                    <td class="col-md-4">
<code>constructor(route: <a href="https://angular.io/api/router/ActivatedRoute" target="_blank">ActivatedRoute</a>, router: <a href="https://angular.io/api/router/Router" target="_blank">Router</a>, dialog: MatDialog, helperService: <a href="../injectables/HelperService.html" target="_self">HelperService</a>, clusterService: <a href="../injectables/ClusterService.html" target="_self">ClusterService</a>, instanceService: <a href="../injectables/InstanceService.html" target="_self">InstanceService</a>)</code>
                    </td>
                </tr>
                        <tr>
                            <td class="col-md-4">
                                <div class="io-line">Defined in <a href="" data-line="31" class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:31</a></div>
                            </td>
                        </tr>

                <tr>
                    <td class="col-md-4">
                            <div>
                                    <b>Parameters :</b>
                                    <table class="params">
                                        <thead>
                                            <tr>
                                                <td>Name</td>
                                                    <td>Type</td>
                                                <td>Optional</td>
                                            </tr>
                                        </thead>
                                        <tbody>
                                                <tr>
                                                        <td>route</td>
                                                  
                                                        <td>
                                                                        <code><a href="https://angular.io/api/router/ActivatedRoute" target="_blank" >ActivatedRoute</a></code>
                                                        </td>
                                                  
                                                    <td>
                                                            No
                                                    </td>
                                                    
                                                </tr>
                                                <tr>
                                                        <td>router</td>
                                                  
                                                        <td>
                                                                        <code><a href="https://angular.io/api/router/Router" target="_blank" >Router</a></code>
                                                        </td>
                                                  
                                                    <td>
                                                            No
                                                    </td>
                                                    
                                                </tr>
                                                <tr>
                                                        <td>dialog</td>
                                                  
                                                        <td>
                                                                    <code>MatDialog</code>
                                                        </td>
                                                  
                                                    <td>
                                                            No
                                                    </td>
                                                    
                                                </tr>
                                                <tr>
                                                        <td>helperService</td>
                                                  
                                                        <td>
                                                                        <code><a href="../injectables/HelperService.html" target="_self" >HelperService</a></code>
                                                        </td>
                                                  
                                                    <td>
                                                            No
                                                    </td>
                                                    
                                                </tr>
                                                <tr>
                                                        <td>clusterService</td>
                                                  
                                                        <td>
                                                                        <code><a href="../injectables/ClusterService.html" target="_self" >ClusterService</a></code>
                                                        </td>
                                                  
                                                    <td>
                                                            No
                                                    </td>
                                                    
                                                </tr>
                                                <tr>
                                                        <td>instanceService</td>
                                                  
                                                        <td>
                                                                        <code><a href="../injectables/InstanceService.html" target="_self" >InstanceService</a></code>
                                                        </td>
                                                  
                                                    <td>
                                                            No
                                                    </td>
                                                    
                                                </tr>
                                        </tbody>
                                    </table>
                            </div>
                    </td>
                </tr>
            </tbody>
        </table>
</section>





    <section>
    
    <h3 id="methods">
        Methods
    </h3>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="activateCluster"></a>
                    <span class="name">
                        <span ><b>activateCluster</b></span>
                        <a href="#activateCluster"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
<code>activateCluster()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="122"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:122</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="addInstance"></a>
                    <span class="name">
                        <span ><b>addInstance</b></span>
                        <a href="#addInstance"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
<code>addInstance()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="59"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:59</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="deleteCluster"></a>
                    <span class="name">
                        <span ><b>deleteCluster</b></span>
                        <a href="#deleteCluster"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
<code>deleteCluster()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="197"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:197</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="disableCluster"></a>
                    <span class="name">
                        <span ><b>disableCluster</b></span>
                        <a href="#disableCluster"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
<code>disableCluster()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="115"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:115</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="disableMaintenanceMode"></a>
                    <span class="name">
                        <span ><b>disableMaintenanceMode</b></span>
                        <a href="#disableMaintenanceMode"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
<code>disableMaintenanceMode()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="190"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:190</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="enableCluster"></a>
                    <span class="name">
                        <span ><b>enableCluster</b></span>
                        <a href="#enableCluster"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
<code>enableCluster()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="108"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:108</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="enableMaintenanceMode"></a>
                    <span class="name">
                        <span ><b>enableMaintenanceMode</b></span>
                        <a href="#enableMaintenanceMode"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
<code>enableMaintenanceMode()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="163"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:163</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="loadCluster"></a>
                    <span class="name">
                        <span class="modifier">Protected</span>
                        <span ><b>loadCluster</b></span>
                        <a href="#loadCluster"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
                    <span class="modifier-icon icon ion-ios-reset"></span>
                    <code>loadCluster()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="50"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:50</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="ngOnInit"></a>
                    <span class="name">
                        <span ><b>ngOnInit</b></span>
                        <a href="#ngOnInit"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
            <tr>
                <td class="col-md-4">
<code>ngOnInit()</code>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">
                    <div class="io-line">Defined in <a href="" data-line="42"
                            class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:42</a></div>
                </td>
            </tr>


            <tr>
                <td class="col-md-4">

                    <div class="io-description">
                        <b>Returns : </b>        <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>

                    </div>
                </td>
            </tr>
        </tbody>
    </table>
</section>
    <section>
    
    <h3 id="inputs">
        Properties
    </h3>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="can"></a>
                    <span class="name">
                        <span ><b>can</b></span>
                        <a href="#can"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
                <tr>
                    <td class="col-md-4">
                        <i>Default value : </i><code>false</code>
                    </td>
                </tr>
                    <tr>
                        <td class="col-md-4">
                                <div class="io-line">Defined in <a href="" data-line="31" class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:31</a></div>
                        </td>
                    </tr>


        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="cluster"></a>
                    <span class="name">
                        <span ><b>cluster</b></span>
                        <a href="#cluster"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
                <tr>
                    <td class="col-md-4">
                        <i>Type : </i>        <code><a href="../classes/Cluster.html" target="_self" >Cluster</a></code>

                    </td>
                </tr>
                    <tr>
                        <td class="col-md-4">
                                <div class="io-line">Defined in <a href="" data-line="30" class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:30</a></div>
                        </td>
                    </tr>


        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="clusterName"></a>
                    <span class="name">
                        <span ><b>clusterName</b></span>
                        <a href="#clusterName"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
                <tr>
                    <td class="col-md-4">
                        <i>Type : </i>        <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>

                    </td>
                </tr>
                    <tr>
                        <td class="col-md-4">
                                <div class="io-line">Defined in <a href="" data-line="29" class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:29</a></div>
                        </td>
                    </tr>


        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="isLoading"></a>
                    <span class="name">
                        <span ><b>isLoading</b></span>
                        <a href="#isLoading"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
                <tr>
                    <td class="col-md-4">
                        <i>Default value : </i><code>false</code>
                    </td>
                </tr>
                    <tr>
                        <td class="col-md-4">
                                <div class="io-line">Defined in <a href="" data-line="28" class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:28</a></div>
                        </td>
                    </tr>


        </tbody>
    </table>
    <table class="table table-sm table-bordered">
        <tbody>
            <tr>
                <td class="col-md-4">
                    <a name="tabLinks"></a>
                    <span class="name">
                            <span class="modifier">Readonly</span>
                        <span ><b>tabLinks</b></span>
                        <a href="#tabLinks"><span class="icon ion-ios-link"></span></a>
                    </span>
                </td>
            </tr>
                <tr>
                    <td class="col-md-4">
                        <i>Type : </i>    <code>[]</code>

                    </td>
                </tr>
                <tr>
                    <td class="col-md-4">
                        <i>Default value : </i><code>[
    { label: &#x27;Dashboard (beta)&#x27;, link: &#x27;dashboard&#x27; },
    { label: &#x27;Resources&#x27;, link: &#x27;resources&#x27; },
    { label: &#x27;Workflows&#x27;, link: &#x27;workflows&#x27; },
    { label: &#x27;Instances&#x27;, link: &#x27;instances&#x27; },
    { label: &#x27;Configuration&#x27;, link: &#x27;configs&#x27; },
  ]</code>
                    </td>
                </tr>
                    <tr>
                        <td class="col-md-4">
                                <div class="io-line">Defined in <a href="" data-line="20" class="link-to-prism">src/app/cluster/cluster-detail/cluster-detail.component.ts:20</a></div>
                        </td>
                    </tr>


        </tbody>
    </table>
</section>

</div>


    <div class="tab-pane fade  tab-source-code" id="c-source">
        <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { map } from &#x27;rxjs/operators&#x27;;
import { Component, OnInit } from &#x27;@angular/core&#x27;;
import { ActivatedRoute, Router } from &#x27;@angular/router&#x27;;
import { MatDialog } from &#x27;@angular/material/dialog&#x27;;

import { Cluster } from &#x27;../shared/cluster.model&#x27;;
import { HelperService } from &#x27;../../shared/helper.service&#x27;;
import { ClusterService } from &#x27;../shared/cluster.service&#x27;;
import { InstanceService } from &#x27;../../instance/shared/instance.service&#x27;;
import { AlertDialogComponent } from &#x27;../../shared/dialog/alert-dialog/alert-dialog.component&#x27;;
import { InputDialogComponent } from &#x27;../../shared/dialog/input-dialog/input-dialog.component&#x27;;

@Component({
  selector: &#x27;hi-cluster-detail&#x27;,
  templateUrl: &#x27;./cluster-detail.component.html&#x27;,
  styleUrls: [&#x27;./cluster-detail.component.scss&#x27;],
  providers: [InstanceService],
})
export class ClusterDetailComponent implements OnInit {
  readonly tabLinks &#x3D; [
    { label: &#x27;Dashboard (beta)&#x27;, link: &#x27;dashboard&#x27; },
    { label: &#x27;Resources&#x27;, link: &#x27;resources&#x27; },
    { label: &#x27;Workflows&#x27;, link: &#x27;workflows&#x27; },
    { label: &#x27;Instances&#x27;, link: &#x27;instances&#x27; },
    { label: &#x27;Configuration&#x27;, link: &#x27;configs&#x27; },
  ];

  isLoading &#x3D; false;
  clusterName: string; // for better UX needs
  cluster: Cluster;
  can &#x3D; false;

  constructor(
    protected route: ActivatedRoute,
    protected router: Router,
    protected dialog: MatDialog,
    protected helperService: HelperService,
    protected clusterService: ClusterService,
    protected instanceService: InstanceService
  ) {}

  ngOnInit() {
    this.clusterService.can().subscribe((data) &#x3D;&gt; (this.can &#x3D; data));
    this.route.params.pipe(map((p) &#x3D;&gt; p.name)).subscribe((name) &#x3D;&gt; {
      this.clusterName &#x3D; name;
      this.loadCluster();
    });
  }

  protected loadCluster() {
    this.isLoading &#x3D; true;
    this.clusterService.get(this.clusterName).subscribe(
      (data) &#x3D;&gt; (this.cluster &#x3D; data),
      (error) &#x3D;&gt; this.helperService.showError(error),
      () &#x3D;&gt; (this.isLoading &#x3D; false)
    );
  }

  addInstance() {
    this.dialog
      .open(InputDialogComponent, {
        data: {
          title: &#x27;Add a new Instance&#x27;,
          message: &#x27;Please enter the following information to continue:&#x27;,
          values: {
            host: {
              label: &#x27;Hostname&#x27;,
            },
            port: {
              label: &#x27;Port&#x27;,
            },
            enabled: {
              label: &#x27;Enabled&#x27;,
              type: &#x27;boolean&#x27;,
            },
          },
        },
      })
      .afterClosed()
      .subscribe((result) &#x3D;&gt; {
        if (result) {
          this.instanceService
            .create(
              this.cluster.name,
              result.host.value,
              result.port.value,
              result.enabled.value
            )
            .subscribe(
              (data) &#x3D;&gt; {
                this.helperService.showSnackBar(&#x27;New Instance added!&#x27;);
                // temporarily navigate back to instance view to refresh
                // will fix this using ngrx/store
                this.router.navigate([&#x27;workflows&#x27;], { relativeTo: this.route });
                setTimeout(() &#x3D;&gt; {
                  this.router.navigate([&#x27;instances&#x27;], {
                    relativeTo: this.route,
                  });
                }, 100);
              },
              (error) &#x3D;&gt; this.helperService.showError(error),
              () &#x3D;&gt; {}
            );
        }
      });
  }

  enableCluster() {
    this.clusterService.enable(this.clusterName).subscribe(
      () &#x3D;&gt; this.loadCluster(),
      (error) &#x3D;&gt; this.helperService.showError(error)
    );
  }

  disableCluster() {
    this.clusterService.disable(this.clusterName).subscribe(
      () &#x3D;&gt; this.loadCluster(),
      (error) &#x3D;&gt; this.helperService.showError(error)
    );
  }

  activateCluster() {
    this.dialog
      .open(InputDialogComponent, {
        data: {
          title: &#x27;Activate this Cluster&#x27;,
          message:
            &#x27;To link this cluster to a Helix super cluster (controller), please enter the super cluster name:&#x27;,
          values: {
            name: {
              label: &#x27;super cluster name&#x27;,
            },
          },
        },
      })
      .afterClosed()
      .subscribe((result) &#x3D;&gt; {
        if (result &amp;&amp; result.name.value) {
          this.clusterService
            .activate(this.clusterName, result.name.value)
            .subscribe(
              () &#x3D;&gt; {
                // since this action may delay a little bit, to prevent re-activation,
                // use an alert dialog to reload the data later
                this.dialog
                  .open(AlertDialogComponent, {
                    data: {
                      title: &#x27;Cluster Activated&#x27;,
                      message: &#x60;Cluster &#x27;${this.clusterName}&#x27; is linked to super cluster &#x27;${result.name.value}&#x27;.&#x60;,
                    },
                  })
                  .afterClosed()
                  .subscribe(() &#x3D;&gt; {
                    this.loadCluster();
                  });
              },
              (error) &#x3D;&gt; this.helperService.showError(error)
            );
        }
      });
  }

  enableMaintenanceMode() {
    this.dialog
      .open(InputDialogComponent, {
        data: {
          title: &#x27;Enable maintenance mode&#x27;,
          message:
            &#x27;What reason do you want to use to put the cluster in maintenance mode?&#x27;,
          values: {
            reason: {
              label: &#x27;reason&#x27;,
            },
          },
        },
      })
      .afterClosed()
      .subscribe((result) &#x3D;&gt; {
        if (result &amp;&amp; result.reason.value) {
          this.clusterService
            .enableMaintenanceMode(this.clusterName, result.reason.value)
            .subscribe(
              () &#x3D;&gt; this.loadCluster(),
              (error) &#x3D;&gt; this.helperService.showError(error)
            );
        }
      });
  }

  disableMaintenanceMode() {
    this.clusterService.disableMaintenanceMode(this.clusterName).subscribe(
      () &#x3D;&gt; this.loadCluster(),
      (error) &#x3D;&gt; this.helperService.showError(error)
    );
  }

  deleteCluster() {
    this.helperService
      .showConfirmation(
        &#x27;Are you sure you want to delete this cluster? This cannot be undone.&#x27;,
        &#x27;Confirm Cluster Deletion&#x27;,
        &#x60;Delete Cluster ${this.clusterName}&#x60;
      )
      .then((result) &#x3D;&gt; {
        if (result) {
          this.clusterService.remove(this.cluster.name).subscribe((data) &#x3D;&gt; {
            this.helperService.showSnackBar(
              &#x60;Cluster ${this.clusterName} deleted&#x60;
            );
            // FIXME: should reload cluster list as well
            this.router.navigate([&#x27;..&#x27;], { relativeTo: this.route });
          });
        }
      });
  }
}
</code></pre>
    </div>

    <div class="tab-pane fade " id="c-templateData">
        <pre class="line-numbers"><code class="language-html">&lt;!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ &quot;License&quot;); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  --&gt;

&lt;section *ngIf&#x3D;&quot;clusterName&quot; class&#x3D;&quot;cluster-detail&quot; fxLayout&#x3D;&quot;column&quot; fxFill&gt;
  &lt;mat-toolbar class&#x3D;&quot;mat-elevation-z1&quot; fxFlex&#x3D;&quot;none&quot;&gt;
    &lt;mat-toolbar-row&gt;
      &lt;hi-detail-header [cluster]&#x3D;&quot;clusterName&quot;&gt;&lt;/hi-detail-header&gt;
      &lt;hi-disabled-label
        *ngIf&#x3D;&quot;!cluster?.enabled&quot;
        text&#x3D;&quot;DISABLED&quot;
      &gt;&lt;/hi-disabled-label&gt;
      &lt;hi-disabled-label
        *ngIf&#x3D;&quot;cluster?.inMaintenance&quot;
        text&#x3D;&quot;In Maintenance Mode&quot;
      &gt;&lt;/hi-disabled-label&gt;
    &lt;/mat-toolbar-row&gt;
    &lt;mat-toolbar-row class&#x3D;&quot;information&quot;&gt;
      &lt;mat-spinner *ngIf&#x3D;&quot;isLoading&quot; diameter&#x3D;&quot;30&quot;&gt;&lt;/mat-spinner&gt;
      &lt;h6 *ngIf&#x3D;&quot;!isLoading&quot;&gt;
        Controller:
        &lt;a mat-button color&#x3D;&quot;accent&quot; routerLink&#x3D;&quot;controller&quot;&gt;{{
          cluster.controller
        }}&lt;/a&gt;
      &lt;/h6&gt;
      &lt;span fxFlex&#x3D;&quot;1 1 auto&quot;&gt;&lt;/span&gt;
      &lt;button mat-mini-fab *ngIf&#x3D;&quot;can&quot; [matMenuTriggerFor]&#x3D;&quot;menu&quot;&gt;
        &lt;mat-icon&gt;menu&lt;/mat-icon&gt;
      &lt;/button&gt;
      &lt;mat-menu #menu&#x3D;&quot;matMenu&quot;&gt;
        &lt;button
          mat-menu-item
          *ngIf&#x3D;&quot;cluster?.controller &#x3D;&#x3D;&#x3D; &#x27;No Lead Controller!&#x27;&quot;
          (click)&#x3D;&quot;activateCluster()&quot;
        &gt;
          &lt;mat-icon&gt;settings_input_antenna&lt;/mat-icon&gt;
          &lt;span&gt;Activate this Cluster&lt;/span&gt;
        &lt;/button&gt;
        &lt;button
          mat-menu-item
          *ngIf&#x3D;&quot;!cluster?.inMaintenance&quot;
          (click)&#x3D;&quot;enableMaintenanceMode()&quot;
        &gt;
          &lt;mat-icon&gt;music_off&lt;/mat-icon&gt;
          &lt;span&gt;Enable maintenance mode&lt;/span&gt;
        &lt;/button&gt;
        &lt;button
          mat-menu-item
          *ngIf&#x3D;&quot;cluster?.inMaintenance&quot;
          (click)&#x3D;&quot;disableMaintenanceMode()&quot;
        &gt;
          &lt;mat-icon&gt;music_note&lt;/mat-icon&gt;
          &lt;span&gt;Disable maintenance mode&lt;/span&gt;
        &lt;/button&gt;
        &lt;button
          mat-menu-item
          *ngIf&#x3D;&quot;cluster?.enabled&quot;
          (click)&#x3D;&quot;disableCluster()&quot;
        &gt;
          &lt;mat-icon&gt;not_interested&lt;/mat-icon&gt;
          &lt;span&gt;Disable this Cluster&lt;/span&gt;
        &lt;/button&gt;
        &lt;button
          mat-menu-item
          *ngIf&#x3D;&quot;!cluster?.enabled&quot;
          (click)&#x3D;&quot;enableCluster()&quot;
        &gt;
          &lt;mat-icon&gt;play_circle_outline&lt;/mat-icon&gt;
          &lt;span&gt;Enable this Cluster&lt;/span&gt;
        &lt;/button&gt;
        &lt;button mat-menu-item *ngIf&#x3D;&quot;false&quot; (click)&#x3D;&quot;addResource()&quot;&gt;
          &lt;mat-icon&gt;note_add&lt;/mat-icon&gt;
          &lt;span&gt;Add a Resource&lt;/span&gt;
        &lt;/button&gt;
        &lt;button mat-menu-item (click)&#x3D;&quot;addInstance()&quot;&gt;
          &lt;mat-icon&gt;add_circle&lt;/mat-icon&gt;
          &lt;span&gt;Add an Instance&lt;/span&gt;
        &lt;/button&gt;
        &lt;button mat-menu-item (click)&#x3D;&quot;deleteCluster()&quot;&gt;
          &lt;mat-icon&gt;delete&lt;/mat-icon&gt;
          &lt;span&gt;DELETE this Cluster&lt;/span&gt;
        &lt;/button&gt;
      &lt;/mat-menu&gt;
    &lt;/mat-toolbar-row&gt;
  &lt;/mat-toolbar&gt;
  &lt;nav mat-tab-nav-bar&gt;
    &lt;a
      mat-tab-link
      *ngFor&#x3D;&quot;let tabLink of tabLinks&quot;
      [routerLink]&#x3D;&quot;tabLink.link&quot;
      routerLinkActive
      #rla&#x3D;&quot;routerLinkActive&quot;
      [active]&#x3D;&quot;rla.isActive&quot;
    &gt;
      {{ tabLink.label }}
    &lt;/a&gt;
  &lt;/nav&gt;
  &lt;section fxFlex&gt;
    &lt;router-outlet&gt;&lt;/router-outlet&gt;
  &lt;/section&gt;
&lt;/section&gt;
</code></pre>
    </div>

    <div class="tab-pane fade " id="c-styleData">
                <p class="comment">
                    <code>./cluster-detail.component.scss</code>
                </p>
                <pre class="line-numbers"><code class="language-scss">.mat-spinner {
  margin: 0 20px;
}

.mat-toolbar h6 {
  font-size: 14px;
}
</code></pre>
    </div>

    <div class="tab-pane fade " id="c-tree">
        <div id="tree-container"></div>
        <div class="tree-legend">
            <div class="title">
                <b>Legend</b>
            </div>
            <div>
                <div class="color htmlelement"></div><span>Html element</span>
            </div>
            <div>
                <div class="color component"></div><span>Component</span>
            </div>
            <div>
                <div class="color directive"></div><span>Html element with directive</span>
            </div>
        </div>
    </div>

    
</div>

<script src="../js/libs/vis.min.js"></script>
<script src="../js/libs/htmlparser.js"></script>
<script src="../js/libs/deep-iterator.js"></script>
<script>
        var COMPONENT_TEMPLATE = '<div><!--  ~ Licensed to the Apache Software Foundation (ASF) under one  ~ or more contributor license agreements.  See the NOTICE file  ~ distributed with this work for additional information  ~ regarding copyright ownership.  The ASF licenses this file  ~ to you under the Apache License, Version 2.0 (the  ~ "License"); you may not use this file except in compliance  ~ with the License.  You may obtain a copy of the License at  ~  ~     http://www.apache.org/licenses/LICENSE-2.0  ~  ~ Unless required by applicable law or agreed to in writing,  ~ software distributed under the License is distributed on an  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY  ~ KIND, either express or implied.  See the License for the  ~ specific language governing permissions and limitations  ~ under the License.  --><section *ngIf="clusterName" class="cluster-detail" fxLayout="column" fxFill>  <mat-toolbar class="mat-elevation-z1" fxFlex="none">    <mat-toolbar-row>      <hi-detail-header [cluster]="clusterName"></hi-detail-header>      <hi-disabled-label        *ngIf="!cluster?.enabled"        text="DISABLED"      ></hi-disabled-label>      <hi-disabled-label        *ngIf="cluster?.inMaintenance"        text="In Maintenance Mode"      ></hi-disabled-label>    </mat-toolbar-row>    <mat-toolbar-row class="information">      <mat-spinner *ngIf="isLoading" diameter="30"></mat-spinner>      <h6 *ngIf="!isLoading">        Controller:        <a mat-button color="accent" routerLink="controller">{{          cluster.controller        }}</a>      </h6>      <span fxFlex="1 1 auto"></span>      <button mat-mini-fab *ngIf="can" [matMenuTriggerFor]="menu">        <mat-icon>menu</mat-icon>      </button>      <mat-menu #menu="matMenu">        <button          mat-menu-item          *ngIf="cluster?.controller === \'No Lead Controller!\'"          (click)="activateCluster()"        >          <mat-icon>settings_input_antenna</mat-icon>          <span>Activate this Cluster</span>        </button>        <button          mat-menu-item          *ngIf="!cluster?.inMaintenance"          (click)="enableMaintenanceMode()"        >          <mat-icon>music_off</mat-icon>          <span>Enable maintenance mode</span>        </button>        <button          mat-menu-item          *ngIf="cluster?.inMaintenance"          (click)="disableMaintenanceMode()"        >          <mat-icon>music_note</mat-icon>          <span>Disable maintenance mode</span>        </button>        <button          mat-menu-item          *ngIf="cluster?.enabled"          (click)="disableCluster()"        >          <mat-icon>not_interested</mat-icon>          <span>Disable this Cluster</span>        </button>        <button          mat-menu-item          *ngIf="!cluster?.enabled"          (click)="enableCluster()"        >          <mat-icon>play_circle_outline</mat-icon>          <span>Enable this Cluster</span>        </button>        <button mat-menu-item *ngIf="false" (click)="addResource()">          <mat-icon>note_add</mat-icon>          <span>Add a Resource</span>        </button>        <button mat-menu-item (click)="addInstance()">          <mat-icon>add_circle</mat-icon>          <span>Add an Instance</span>        </button>        <button mat-menu-item (click)="deleteCluster()">          <mat-icon>delete</mat-icon>          <span>DELETE this Cluster</span>        </button>      </mat-menu>    </mat-toolbar-row>  </mat-toolbar>  <nav mat-tab-nav-bar>    <a      mat-tab-link      *ngFor="let tabLink of tabLinks"      [routerLink]="tabLink.link"      routerLinkActive      #rla="routerLinkActive"      [active]="rla.isActive"    >      {{ tabLink.label }}    </a>  </nav>  <section fxFlex>    <router-outlet></router-outlet>  </section></section></div>'
    var COMPONENTS = [{'name': 'AlertDialogComponent', 'selector': 'hi-alert-dialog'},{'name': 'AppComponent', 'selector': 'hi-root'},{'name': 'ClusterComponent', 'selector': 'hi-cluster'},{'name': 'ClusterDetailComponent', 'selector': 'hi-cluster-detail'},{'name': 'ClusterListComponent', 'selector': 'hi-cluster-list'},{'name': 'ConfigDetailComponent', 'selector': 'hi-config-detail'},{'name': 'ConfirmDialogComponent', 'selector': 'hi-confirm-dialog'},{'name': 'ConfirmDialogTestComponent', 'selector': 'hi-confirm-dialog-test'},{'name': 'ControllerDetailComponent', 'selector': 'hi-controller-detail'},{'name': 'DashboardComponent', 'selector': 'hi-dashboard'},{'name': 'DataTableComponent', 'selector': 'hi-data-table'},{'name': 'DetailHeaderComponent', 'selector': 'hi-detail-header'},{'name': 'DisabledLabelComponent', 'selector': 'hi-disabled-label'},{'name': 'HelixListComponent', 'selector': 'hi-helix-list'},{'name': 'HistoryListComponent', 'selector': 'hi-history-list'},{'name': 'InputDialogComponent', 'selector': 'hi-input-dialog'},{'name': 'InputInlineComponent', 'selector': 'hi-input-inline'},{'name': 'InstanceDetailComponent', 'selector': 'hi-instance-detail'},{'name': 'InstanceListComponent', 'selector': 'hi-instance-list'},{'name': 'JobDetailComponent', 'selector': 'hi-job-detail'},{'name': 'JobListComponent', 'selector': 'hi-job-list'},{'name': 'JsonViewerComponent', 'selector': 'hi-json-viewer'},{'name': 'KeyValuePairsComponent', 'selector': 'hi-key-value-pairs'},{'name': 'NodeViewerComponent', 'selector': 'hi-node-viewer'},{'name': 'PartitionDetailComponent', 'selector': 'hi-partition-detail'},{'name': 'PartitionListComponent', 'selector': 'hi-partition-list'},{'name': 'ResourceDetailComponent', 'selector': 'hi-resource-detail'},{'name': 'ResourceDetailForInstanceComponent', 'selector': 'hi-resource-detail-for-instance'},{'name': 'ResourceListComponent', 'selector': 'hi-resource-list'},{'name': 'ResourceNodeViewerComponent', 'selector': 'hi-resource-node-viewer'},{'name': 'StateLabelComponent', 'selector': 'hi-state-label'},{'name': 'WorkflowDagComponent', 'selector': 'hi-workflow-dag'},{'name': 'WorkflowDetailComponent', 'selector': 'hi-workflow-detail'},{'name': 'WorkflowListComponent', 'selector': 'hi-workflow-list'}];
    var DIRECTIVES = [{'name': 'KeyValuePairDirective', 'selector': 'hi-key-value-pair'}];
    var ACTUAL_COMPONENT = {'name': 'ClusterDetailComponent'};
</script>
<script src="../js/tree.js"></script>

















                   </div><div class="search-results">
    <div class="has-results">
        <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
        <ul class="search-results-list"></ul>
    </div>
    <div class="no-results">
        <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
    </div>
</div>
</div>
               <!-- END CONTENT -->
           </div>
       </div>

          <label class="dark-mode-switch">
               <input type="checkbox">
               <span class="slider">
                    <svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
                    <path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
                    </svg>
               </span>
          </label>

       <script>
            var COMPODOC_CURRENT_PAGE_DEPTH = 1;
            var COMPODOC_CURRENT_PAGE_CONTEXT = 'component';
            var COMPODOC_CURRENT_PAGE_URL = 'ClusterDetailComponent.html';
            var MAX_SEARCH_RESULTS = 15;
       </script>

       <script src="../js/libs/custom-elements.min.js"></script>
       <script src="../js/libs/lit-html.js"></script>

       <script src="../js/menu-wc.js" defer></script>
       <script nomodule src="../js/menu-wc_es5.js" defer></script>

       <script src="../js/libs/bootstrap-native.js"></script>

       <script src="../js/libs/es6-shim.min.js"></script>
       <script src="../js/libs/EventDispatcher.js"></script>
       <script src="../js/libs/promise.min.js"></script>
       <script src="../js/libs/zepto.min.js"></script>

       <script src="../js/compodoc.js"></script>

       <script src="../js/tabs.js"></script>
       <script src="../js/menu.js"></script>
       <script src="../js/libs/clipboard.min.js"></script>
       <script src="../js/libs/prism.js"></script>
       <script src="../js/sourceCode.js"></script>
          <script src="../js/search/search.js"></script>
          <script src="../js/search/lunr.min.js"></script>
          <script src="../js/search/search-lunr.js"></script>
          <script src="../js/search/search_index.js"></script>
       <script src="../js/lazy-load-graphs.js"></script>


    </body>
</html>
